﻿using DAL.Permission.Shop;
using Model.Permission;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BLL.Permission.Shop
{
    public class UserRoleAssignBLL
    {
        private readonly UserRoleAssignDAL dal = new UserRoleAssignDAL();
        public UserRoleAssignBLL()
        { }

        /// <summary>
        /// Judge if is admin
        /// </summary>
        /// <param name="uid"></param>
        /// <returns></returns>
        public bool IsAdmin(int uid)
        {
            return dal.IsAdmin(uid);
        }

        /// <summary>
        /// 删除数据
        /// </summary>
        public bool DeleteByUser(int U_Id)
        {
            return dal.DeleteByUser(U_Id);
        }

        /// <summary>
        /// 是否存在该记录
        /// </summary>
        public bool ExistsByRole(int RoleID)
        {
            return dal.ExistsByRole(RoleID);
        }

        /// <summary>
        /// 是否存在该记录
        /// </summary>
        public bool Exists(int UserRoleAssignID)
        {
            return dal.Exists(UserRoleAssignID);
        }

        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(UserRoleAssignEntity model)
        {
            return dal.Add(model);
        }

        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(UserRoleAssignEntity model)
        {
            return dal.Update(model);
        }

        /// <summary>
        /// 删除一条数据
        /// </summary>
        public bool Delete(int UserRoleAssignID)
        {

            return dal.Delete(UserRoleAssignID);
        }
        /// <summary>
        /// 删除一条数据
        /// </summary>
        public bool DeleteList(string UserRoleAssignIDlist)
        {
            return dal.DeleteList(UserRoleAssignIDlist);
        }

        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public UserRoleAssignEntity GetModel(int UserRoleAssignID)
        {

            return dal.GetModel(UserRoleAssignID);
        }

    }
}
